const API_HOST = "https://v2.tool.growthupup.com/api"
const ReqClient = (url, method, data) => {
  return new Promise((resolve, reject) => {
    wx.request({
      url: API_HOST + url,
      method,
      data,
      success: (res) => resolve(res),
      fail: err => reject(err)
    })
  })
}
/*用户*/
//获取登录信息
export const login = ({
  phone,
  password
}) => {
  return ReqClient('/public/index/user/login', 'POST', {
    phone,
    password
  })    
}
// 注册接口
export const register = ({
  phone,
  phone_code,
  password,
  avatarUrl,
  nickName
}) => {
  return ReqClient('/public/index/user/register', 'POST', {
    phone,
    phone_code,
    password,
    avatarUrl,
    nickName
  })
}
// 发送短信
export const sms = ({
  phone,
  template
}) => {
  return ReqClient('/public/index/user/sms', "POST", {
    phone,
    template
  })
}
// 忘记密码
export const forgetPwd = ({
  phone,
  phone_code,
  password
}) => {
  return ReqClient('/public/index/user/forget_pwd', 'POST', {
    phone,
    phone_code,
    password
  })
}
/*首页数据*/
//数据统计
export const stats = ({
  token
}) => {
  return ReqClient('/public/index/homepage/index', 'POST', {
    token
  })
}
//待办事项
export const todoList = ({
  token
}) => {
  return ReqClient('/public/index/homepage/todolist', 'POST', {
    token
  })
}
//通知列表
export const noticeList = ({
  token,
  page,
  singlepage,
  is_read
}) => {
  return ReqClient('/public/index/notice/notice_list', 'POST', {
    token,
    page,
    singlepage,
    is_read
  })
}
//通知读取状态调整
export const isRead = ({
  token,
  id
}) => {
  return ReqClient('/public/index/notice/is_read', 'POST', {
    token,
    id
  })
}

/*添加商品*/
// 添加商品所需下拉框
export const addMerchant = ({
  token,
  supperior_id,
  type
}) => {
  return ReqClient('/public/index/product/set_add_merchant', "POST", {
    token,
    supperior_id,
    type
  })
}
//获取店铺下拉框
export const storeList = ({
  token,
}) => {
  return ReqClient('/public/index/product/store_list', "POST", {
    token,
  })
}
//获取员工下拉框
export const staffList = ({
  token,
  store_id
}) => {
  return ReqClient('/public/index/product/staff_list', "POST", {
    token,
    store_id,
  })
}
//获取商品类目
export const systematicsList = ({
  token,
  parent_id,
}) => {
  return ReqClient('/public/index/product/get_product_category', "POST", {
    token,
    parent_id,
  })
}
//获取品品牌系类
export const getProductBrand = ({
  token,
  brand_id,
}) => {
  return ReqClient('/public/index/product/get_product_brand', "POST", {
    token,
    brand_id,
  })
}
//品牌模糊搜索
export const brandLike = ({
  token,
  title_all,
}) => {
  return ReqClient('/public/index/product/brand_like', "POST", {
    token,
    title_all,
  })
}
//品类模糊搜索
export const seriesLike = ({
  token,
  title,
  brand_id
}) => {
  return ReqClient('/public/index/product/series_like', "POST", {
    token,
    title,
    brand_id
  })
}
//添加商品（保存）
export const addEdit = ({
  token,
  additional,
  coordinate,
  cost_price,
  image,
  is_network,
  is_onsale,
  is_shelf,
  library_age,
  maintenance,
  peer_price,
  price,
  procurement_status,
  product_cate,
  product_code,
  product_condition,
  product_name,
  product_sn,
  product_source,
  remark,
  staff_id,
  stock,
  store_id,
  synopsis,
  category_id,
  type_id,
  brand_id,
  systematics_id
}) => {
  return ReqClient('/public/index/product/add_edit', "POST", {
    token,
    additional,
    coordinate,
    cost_price,
    image,
    is_network,
    is_onsale,
    is_shelf,
    library_age,
    maintenance,
    peer_price,
    price,
    procurement_status,
    product_cate,
    product_code,
    product_condition,
    product_name,
    product_sn,
    product_source,
    remark,
    staff_id,
    stock,
    store_id,
    synopsis,
    category_id,
    type_id,
    brand_id,
    systematics_id
  })
}

//图片上传到七牛，向后端获取token接口
export const getToken = () => {
  return ReqClient('/public/index/qiniu/getToken', "POST", {})
}
/*认证*/
//上传图片
export const uploadMerchant = ({
  token,
  file
}) => {
  return ReqClient('/public/index/upload/uploadMerchant', 'POST', {
    token,
    file
  })
}

//企业认证
export const MerchantRegister = ({
  token,
  merFullName,
  merShortName,
  merCertType,
  merCertNo,
  legalIdCard,
  legalName,
  merAddress,
  merCity,
  merDistrict,
  merProvince,
  merContactName,
  merContactPhone,
  merContactEmail,
  taxRegistCert,
  accountLicense,
  orgCode,
  isOrgCodeLong,
  orgCodeExpiry,
  bankCity,
  bankCode,
  bankProvince,
  cardNo,
  headBankCode,
  openMini,
  fileInfo
}) => {
  return ReqClient('/public/index/merchant/merchant_register', 'POST', {
    token,
    merFullName,
    merShortName,
    merCertType,
    merCertNo,
    legalIdCard,
    legalName,
    merAddress,
    merCity,
    merDistrict,
    merProvince,
    merContactName,
    merContactPhone,
    merContactEmail,
    taxRegistCert,
    accountLicense,
    orgCode,
    isOrgCodeLong,
    orgCodeExpiry,
    bankCity,
    bankCode,
    bankProvince,
    cardNo,
    headBankCode,
    openMini,
    fileInfo
  })
}

//省市区三级联动
export const getCity = ({
  token
}) => {
  return ReqClient('/public/index/city/getCities', 'POST', {
    token
  })
}

//省市二级联动
export const getProvinces = ({
  token
}) => {
  return ReqClient('/public//index/city/getProvinces', 'POST', {
    token
  })
}
//获取总行
export const bankList = ({
  token
}) => {
  return ReqClient('/public//index/bankcard/bank_list', 'POST', {
    token
  })
}
//获取分行
export const bankBranchInfo = ({
  token,
  headBankCode,
  provinceCode,
  cityCode
}) => {
  return ReqClient('/public//index/bankcard/bankBranchInfo', 'POST', {
    token,
    headBankCode,
    provinceCode,
    cityCode
  })
}

/*库存管理*/
export const productList = ({
  token,
  page, 
  full_name,
  category_id,
  store_id,
  product_state,
  brand,
  begin_time,
  end_time,
  order,
  price_name,
  begin_price,
  end_price,
  is_onsale,
  is_synchro,
  product_source,
  procurement_status,
  staff_id 

}) => {
  return ReqClient('/public/index/product/product_list', "POST", {
    token,
    page,
    full_name,
    category_id,
    store_id,
    product_state,
    brand,
    begin_time,
    end_time,
    order,
    price_name,
    begin_price,
    end_price,
    is_onsale,
    is_synchro,
    product_source,
    procurement_status,
    staff_id 
  })
}
export const productDetail = ({
  token,
  id
}) => {
  return ReqClient('/public/index/product/product_list_by_id', "POST", {
    token,
    id
  })
}
export const productDetailNew = ({
  token,
  id
}) => {
  return ReqClient('/public/index/product/get_product_by_id', "POST", {
    token,
    id
  })
}
// 通知列表展示商品详情
export const infoGoodsDetail = ({
  token,
  id
}) => {
  return ReqClient('/public/index/notice/notice_by_id', "POST", {
    token,
    id
  })
}
// 搜索
export const productSelect = ({
  token,
  page,
  full_name,
  category_id,
  product_state,
  store_id,
  brand,
  begin_time,
  end_time,
  order,
  price_name,
  begin_price,
  end_price
}) => {
  return ReqClient('/public/index/product/product_select', "POST", {
    token,
    page,
    full_name,
    category_id,
    product_state,
    store_id,
    brand,
    begin_time,
    end_time,
    order,
    price_name,
    begin_price,
    end_price
  })
}
//单个自有商品编辑
export const editGoods = ({
  token,
  page,
  id
}) => {
  return ReqClient('/public/index/product/product_list', "POST", {
    token,
    page,
    id
  })
}
//删除自有商品
export const delGoods = ({
  token,
  id
}) => {
  return ReqClient('/public/index/product/prodict_del', "POST", {
    token,
    id
  })
}
// 编辑商品保存
export const saveEdit = ({
  id,
  token,
  source_product_id,
  synopsis,
  library_age,
  peer_price,
  price,
  cost_price,
  is_onsale,
  is_network,
  remark,
  additional,
  product_source,
  coordinate,
  product_code,
  product_sn,
  product_name,
  product_cate,
  is_sold_business,
  log_url,
  maintenance,
  product_condition,
  procurement_status,
  staff_id,
  store_id,
  category_id,
  type_id,
  brand_id,
  systematics_id,
  is_shelf,
  group_people,
  color,
  material,
  size,
  fineness_description,
  inside_structure,
  activity_price,
  market_price,
  image,
  product_service,
  product_package,
  product_specification,
  watchshell_material,
  watchband_material,
  mechanism,
  diameter,
  fastener_type,
  waterproof,
  guarantee,
  producer,
  stock,
  source_name,
  source_phone,
  brand_other,
  systematics_other,
  peer_price_amount,
  peer_price_currency,
  is_bid,
  bid_price,
  is_bid_sold,
  bid_sold_price,
  bid_phone,
  is_keep,
  keep_price,
  is_unsold,
  unsold_price
}) => {
  return ReqClient('/public/index/product/update_product', "POST", {
    id,
    token,
    source_product_id,
    synopsis,
    library_age,
    peer_price,
    price,
    cost_price,
    is_onsale,
    is_network,
    remark,
    additional,
    product_source,
    coordinate,
    product_code,
    product_sn,
    product_name,
    product_cate,
    is_sold_business,
    log_url,
    maintenance,
    product_condition,
    procurement_status,
    staff_id,
    store_id,
    category_id,
    type_id,
    brand_id,
    systematics_id,
    is_shelf,
    group_people,
    color,
    material,
    size,
    fineness_description,
    inside_structure,
    activity_price,
    market_price,
    image,
    product_service,
    product_package,
    product_specification,
    watchshell_material,
    watchband_material,
    mechanism,
    diameter,
    fastener_type,
    waterproof,
    guarantee,
    producer,
    stock,
    source_name,
    source_phone,
    brand_other,
    systematics_other,
    peer_price_amount,
    peer_price_currency,
    is_bid,
    bid_price,
    is_bid_sold,
    bid_sold_price,
    bid_phone,
    is_keep,
    keep_price,
    is_unsold,
    unsold_price
  })
}
//产品入网
export const isNetwork = ({
  token,
  is_network,
  id
}) => {
  return ReqClient('/public/index/product/is_network', "POST", {
    token,
    is_network,
    id
  })
}
//产品上下架
export const isOnsale = ({
  token,
  is_onsale,
  id
}) => {
  return ReqClient('/public/index/product/is_sale', "POST", {
    token,
    is_onsale,
    id
  })
}
//同步商品详情
export const synchroDetail = ({
  token,
  id
}) => {
  return ReqClient('/public/index/product/is_synchro_selsct_by_id', 'POST', {
    token,
    id
  })
}
//同步商品编辑
export const synchroEdit = ({
  token,
  id,
  price,
  synopsis,
  is_autodeliver,
  name,
  phone,
  province,
  city,
  district,
  address,
  updelivery_id,
  fineness_description
}) => {
  return ReqClient('/public/index/product/is_synchro_updata', 'POST', {
    token,
    id,
    price,
    synopsis,
    is_autodeliver,
    name,
    phone,
    province,
    city,
    district,
    address,
    updelivery_id,
    fineness_description
  })
}
//销售平台
export const salePlateform = ({
  token
}) => {
  return ReqClient('/public/index/dropdown/sales_plateform', 'POST', {
    token
  })
}
//销售状态
export const saleCondition = ({
  token
}) => {
  return ReqClient('/public/index/dropdown/sales_condition', 'POST', {
    token
  })
}
//快递公司
export const shippingCompany = ({
  token
}) => {
  return ReqClient('/public/index/dropdown/shipping_mode', 'POST', {
    token
  })
}
//获取门店下所有店员
export const saler = ({
  token
}) => {
  return ReqClient('/public/index/dropdown/staff_list', 'POST', {
    token
  })
}
//支付模式
export const payMethod = ({
  token
}) => {
  return ReqClient('/public/index/dropdown/payment_mode', 'POST', {
    token
  })
}
//销售编辑
export const sellEdit = ({
  token,
  product_id
}) => {
  return ReqClient('/public/index/product/check_shelf', 'POST', {
    token,
    product_id
  })
}
//销售编辑保存
export const sellSave = ({
  token,
  id,
  cost_price,
  deposit,
  nursing_fee,
  other_fee,
  pay_method,
  phone,
  pre_name,
  price,
  product_name,
  product_num,
  product_sn,
  remark,
  sale_status,
  sale_system,
  saler,
  shipping_company,
  shipping_fee,
  shipping_sn
}) => {
  return ReqClient('/public/index/order/add_sale_order', 'POST', {
    token,
    id,
    cost_price,
    deposit,
    nursing_fee,
    other_fee,
    pay_method,
    phone,
    pre_name,
    price,
    product_name,
    product_num,
    product_sn,
    remark,
    sale_status,
    sale_system,
    saler,
    shipping_company,
    shipping_fee,
    shipping_sn
  })
}

/*全网库存 */
export const allNetwork = ({
  token,
  full_name, //商品名称（模糊搜索）
  phone, //客户手机号（下单用户）
  category_id, //商品大类id
  is_shelf, //库存状态
  is_network, //是否入网 ： 0 否/1是(不用传，默认为1)
  page, //页码（默认1 禁止传0）
  singlepage, //单页条数（默认20）
  brand_name, //品牌名
  peer_price, //价格排序 1 降序 2升序
  time_sort, //最新时间 1 降序 2升序
  shares_sort, //分享 1 降序 2升序
  cart_count_sort //加购 1 降序 2升序

}) => {
  return ReqClient('/public/index/product/all_network', 'POST', {
    token,
    full_name, //商品名称（模糊搜索）
    phone, //客户手机号（下单用户）
    category_id, //商品大类id
    is_shelf, //库存状态
    is_network, //是否入网 ： 0 否/1是(不用传，默认为1)
    page, //页码（默认1 禁止传0）
    singlepage, //单页条数（默认20）
    brand_name, //品牌名
    peer_price, //价格排序 1 降序 2升序
    time_sort, //最新时间 1 降序 2升序
    shares_sort, //分享 1 降序 2升序
    cart_count_sort //加购 1 降序 2升序
  })
}
/*品牌*/
export const brands = ({
  token
}) => {
  return ReqClient('/public/index/product/get_title', "POST", {
    token
  })
}
/*同步库存 */
export const synchro = ({
  token,
  id,
  price,
  synopsis,
  is_autodeliver, //是否自发货
  name, //发货人
  phone, //联系方式
  province, //省（编码）
  city, //市（编码）
  district, //区 （编码）
  address, //详细地址
}) => {
  return ReqClient('/public/index/network/synchro', "POST", {
    token,
    id,
    price,
    synopsis,
    is_autodeliver, //是否自发货
    name, //发货人
    phone, //联系方式
    province, //省（编码）
    city, //市（编码）
    district, //区 （编码）
    address, //详细地址
  })
}
//同步入库商品
export const productInfo = ({
  token,
  id
}) => {
  return ReqClient('/public/index/product/product_info', 'POST', {
    token,
    id
  })
}

/*订单操作 */
//门店订单（线下订单）列表
export const orderList = ({
  token,
  status,
  page
}) => {
  return ReqClient('/public/index/Order/list', 'POST', {
    token,
    status,
    page
  })
}
//门店订单查看订单/编辑
export const orderDetail = ({
  token,
  info_batchcode, //详情订单ID
  status // 获取退货详情时  固定填6  获取其它详情 为空
}) => {
  return ReqClient('/public/index/order/order_info', 'POST', {
    token,
    info_batchcode,
    status,
  })
}
//门店订单提交编辑
export const orderSubmit = ({
  token,
  info_batchcode, //订单详情号
  status, //销售状态
  batchcode, //订单号
  price, //成交价
  deposit, //定金支付
  remark, //备注（可为空）
  other_fee //其他费用
}) => {
  return ReqClient('/public/index/order/edit_order', 'POST', {
    token,
    info_batchcode, //订单详情号
    status, //销售状态
    batchcode, //订单号
    price, //成交价
    deposit, //定金支付
    remark, //备注（可为空）
    other_fee //其他费用
  })
}
//门店订单退货
export const returnGoods = ({
  token,
  info_batchcode, //详情订单ID
  batchcode //订单号
}) => {
  return ReqClient('/public/index/refund/reimburse', 'POST', {
    token,
    info_batchcode,
    batchcode //订单号
  })
}

//小程序订单（线上订单）列表
export const onlineOrderList = ({
  token,
  page,
  type,
  status,
  id
}) => {
  return ReqClient('/public/index/order/order_list', 'POST', {
    token,
    page,
    type,
    status,
    id
  })
}
//小程序订单（线上订单）详情
export const onlineOrderDetails = ({
  token,
  batchcode
}) => {
  return ReqClient('/public/index/order/get_order_info', 'POST', {
    token,
    batchcode
  })
}
//小程序订单去发货
export const goDelivery = ({
  token,
  shipping_code,
  shipping_sn,
  batchcode,
  info_batchcode
}) => {
  return ReqClient('/public/index/order/deliver', 'POST', {
    token,
    shipping_code,
    shipping_sn,
    batchcode,
    info_batchcode
  })
}

/*个人页面加载*/
export const user = ({
  token
}) => {
  return ReqClient('/public/index/user/merchant_profile', 'POST', {
    token
  })
}
/*账单*/
export const bill = ({
  token
}) => {
  return ReqClient('/public/index/user/my_wallet', 'POST', {
    token
  })
}
/*账单列表*/
export const listofBills = ({
  token,
  page, //页码
  start_date, //默认为当前时间
  id //获取账单详情的时候使用
}) => {
  return ReqClient('/public/index/user/billing_details', 'POST', {
    token,
    page,
    start_date,
    id
  })
}
/*账单详情 */
export const listos = ({
  token,
  id
}) => {
  return ReqClient('/public/index/user/bill_details_info', 'POST', {
    token,
    id
  })
}
/*修改登录密码*/
export const login_password = ({
  token,
  oldpassword, //旧密码
  repassword, //重复新密码
  password //新密码
}) => {
  return ReqClient('/public/index/user/updata_pwd', 'POST', {
    token,
    oldpassword,
    repassword,
    password
  })
}

/*修改提现密码*/
export const pay_password = ({
  token,
  oldpassword, //旧密码
  repassword, //重复新密码
  password //新密码
}) => {
  return ReqClient('/public/index/merchant/updata_pay_password', 'POST', {
    token,
    oldpassword,
    repassword,
    password
  })
}
/*是否有提现密码*/
export const whether_pay_password = ({
  token
}) => {
  return ReqClient('/public/index/merchant/in_pay_password', 'POST', {
    token
  })
}
/*设置提现密码*/
export const setUp_pay_password = ({
  token,
  repassword, //重复密码
  password //密码
}) => {
  return ReqClient('/public/index/merchant/set_pay_password', 'POST', {
    token,
    repassword,
    password
  })
}

/*提现信息*/
export const bankcardList = ({
  token,
  id
}) => {
  return ReqClient('/public/index/bankcard/bankcard_list', 'POST', {
    token,
    id
  })
}
/*员工管理*/
export const employeeManagement = ({
  token,
}) => {
  return ReqClient('/public/index/user/get_staff', 'POST', {
    token,
  })
}

/*员工管理按钮*/
export const staff_btn = ({
  token,
  state,
  id
}) => {
  return ReqClient('/public/index/user/updata_staff', 'POST', {
    token,
    state,
    id
  })
}

/*意见反馈*/
export const feedback = ({
  token,
  content,
  contact,
  image
}) => {
  return ReqClient('/public/index/feedback/create', 'POST', {
    token,
    content,
    contact,
    image
  })
}


/*个体商户认证*/
export const individualCertification = ({
  token,
  merFullName,
  merShortName,
  merCertNo,
  legalIdCard,
  legalName,
  merAddress,
  merCity,
  merDistrict,
  merProvince,
  cardNo,
  headBankCode,
  bankCity,
  bankCode,
  bankProvince,
  fileInfo,
  merLegalPhone,
  merLegalEmail,
  openMini
}) => {
  return ReqClient('/public/index/merchant/individual_certification', 'POST', {
    token,
    merFullName,
    merShortName,
    merCertNo,
    legalIdCard,
    legalName,
    merAddress,
    merCity,
    merDistrict,
    merProvince,
    cardNo,
    headBankCode,
    bankCity,
    bankCode,
    bankProvince,
    fileInfo,
    merLegalPhone,
    merLegalEmail,
    openMini
  })
}

/*个人认证*/
export const personalMan = ({
  token,
  merShortName,
  merScope,
  merCertNo,
  legalIdCard,
  legalName,
  merAddress,
  merCity,
  merDistrict,
  merProvince,
  cardNo,
  headBankCode,
  bankCity,
  bankCode,
  bankProvince,
  fileInfo,
  merLegalPhone,
  merLegalEmail
}) => {
  return ReqClient('/public/index/merchant/personal_certification', 'POST', {
    token,
    merShortName,
    merScope,
    merCertNo,
    legalIdCard,
    legalName,
    merAddress,
    merCity,
    merDistrict,
    merProvince,
    cardNo,
    headBankCode,
    bankCity,
    bankCode,
    bankProvince,
    fileInfo,
    merLegalPhone,
    merLegalEmail
  })
}

/*地址管理*/
export const addressMas = ({
  token,
}) => {
  return ReqClient('/public/index/delivery/address_list', 'POST', {
    token,
  })
}

/*地址添加/修改*/
export const modifyAdd = ({
  token,
  id,
  name,
  phone,
  province,
  city,
  district,
  address,
  is_default,
}) => {
  return ReqClient('/public/index/delivery/add_address', 'POST', {
    token,
    id,
    name,
    phone,
    province,
    city,
    district,
    address,
    is_default,
  })
}
/*地址删除*/
export const deleteadd = ({
  token,
  id
}) => {
  return ReqClient('/public/index/delivery/del_address', 'POST', {
    token,
    id
  })
}

export const messageSystem=({
  token
})=>{
  return ReqClient('/public/index/notice/message_system','POST',{
    token
  })
}
/*获取默认地址*/
export const defaultadd = ({
  token
}) => {
  return ReqClient('/public/index/delivery/is_defult', 'POST', {
    token
  })
}
/*一件采购*/
export const addBidOrder = ({
  token,
  product_ids,
  delivery_id,
  total_price,
  remark
}) => {
  return ReqClient('/public/index/auction/add_bid_order', 'POST', {
    token,
    product_ids,
    delivery_id,
    total_price,
    remark
  })
}


/*获取支付订单详情*/
export const detailsPayment = ({
  token,
  batchcode
}) => {
  return ReqClient('/public/index/order/pay_order', 'POST', {
    token,
    batchcode
  })
}
/*支付*/
export const payment = ({
  token,
  batchcode,
  openid,
  total_fee
}) => {
  return ReqClient('/public/index/wechat/pay', 'POST', {
    token,
    batchcode,
    openid,   
    total_fee 
  })
}

/*获取openid*/
export const obtain_openid = ({
  code
}) => {
  return ReqClient('/public/index/wechat/get_openid', 'POST', {
    code
  })
}

// 提现
export const putBtn = ({
  token,
  money,
  pay_password
}) => {
  return ReqClient('/public/index/merchant/withdraw', 'POST', {
    token,
    money,
    pay_password
  })
}

// 取消订单
export const cancelOrder = ({
  token,
  batchcode
}) => {
  return ReqClient('/public/index/order/remove', 'POST', {
    token,
    batchcode
  })
}

//确认收货
export const confirmOrder = ({
  token,
  batchcode
}) => {
  return ReqClient('/public/index/order/confirm_order', 'POST', {
    token,
    batchcode
  })
}

//根据token获取是否上线
export const personalInfo = ({
  token
}) => {
  return ReqClient('/public/index/user/get_verification_by_token', 'POST', {
    token
  })
}
//根据token获取商品状态
export const getProductState=({
  token
})=>{
  return ReqClient('/public/index/product/get_product_state','POST',{
    token
  })
}
//删除订单
export const orderDel=({
  token,
  info_batchcode 
})=>{
  return ReqClient('/public/index/order/order_del','POST',{
    token,
    info_batchcode 
  })
}

//new添加商品
export const addEditProduct = ({
  token,
  image,
  product_cate,
  product_condition,
  is_shelf,
  procurement_status,
  product_state,
  category_id,
  type_id,
  brand_id,
  systematics_id,
  product_code,
  product_sn,
  product_name,
  maintenance,
  store_id,
  coordinate,
  library_age,
  remark,
  cost_price,
  price,
  peer_price,
  additional,
  staff_id,
  activity_price,
  market_price,
  product_service,
  group_people,
  color,
  material,
  size,
  product_package,
  watchshell_material,
  watchband_material,
  mechanism,
  diameter,
  fastener_type,
  waterproof,
  guarantee,
  producer,
  is_onsale,
  is_network,
  stock,
  origin_id,
  product_source,
  fineness_description,
  product_specification,
  inside_structure,
  synopsis,
  source_name,
  source_phone,
  brand_other,
  systematics_other,
  peer_price_amount,
  peer_price_currency,
  is_bid,
  bid_price,
  is_bid_sold,
  bid_sold_price,
  bid_phone,
  is_keep,
  keep_price,
  is_unsold,
  unsold_price
}) => {
  return ReqClient('/public/index/product/add_edit', 'POST', {
    token,
    image,
    product_cate,
    product_condition,
    is_shelf,
    procurement_status,
    product_state,
    category_id,
    type_id,
    brand_id,
    systematics_id,
    product_code,
    product_sn,
    product_name,
    maintenance,
    store_id,
    coordinate,
    library_age,
    remark,
    cost_price,
    price,
    peer_price,
    additional,
    staff_id,
    activity_price,
    market_price,
    product_service,
    group_people,
    color,
    material,
    size,
    product_package,
    watchshell_material,
    watchband_material,
    mechanism,
    diameter,
    fastener_type,
    waterproof,
    guarantee,
    producer,
    is_onsale,
    is_network,
    stock,
    origin_id,
    product_source,
    fineness_description,
    product_specification,
    inside_structure,
    synopsis,
    source_name,
    source_phone,
    brand_other,
    systematics_other,
    peer_price_amount,
    peer_price_currency,
    is_bid,
    bid_price,
    is_bid_sold,
    bid_sold_price,
    bid_phone,
    is_keep,
    keep_price,
    is_unsold,
    unsold_price
  })
}
//清理售磬
export const clearSoldProducts = ({
  token
}) => {
  return ReqClient('/public/index/products/clear_sold_products', 'POST', {
    token
  })
}

// 编辑订单留言
export const editOrderRemark = ({
  token,
  batchcode,
  remark
}) => {
  return ReqClient('/public/index/order/edit_order_remark', 'POST', {
    token,
    batchcode,
    remark
  })
}
// 查看订单留言
export const lookOrderRemark = ({
  token,
  batchcode
}) => {
  return ReqClient('/public/index/order/get_order_remark', 'POST', {
    token,
    batchcode
  })
}
// 编辑商品留言
export const editGoodsRemark = ({
  token,
  id,
  remark
}) => {
  return ReqClient('/public/index/goods/edit_goods_remark', 'POST', {
    token,
    id,
    remark
  })
}
// 查看商品留言
export const lookGoodsRemark = ({
  token,
  id
}) => {
  return ReqClient('/public/index/goods/get_goods_remark', 'POST', {
    token,
    id
  })
}


// 线上订单售后
export const orderRefund = ({
  token
}) => {
  return ReqClient('/public/index/order_refund/list', 'POST', {
    token
  })
}

// 线上订单售后详情
export const orderRefundDetail = ({
  token,
  info_batchcode
}) => {
  return ReqClient('/public/index/order_refund/detail', 'POST', {
    token,
    info_batchcode
  })
}

// 线上订单售后拒绝
export const orderRefundRefuse = ({
  token,
  info_batchcode
}) => {
  return ReqClient('/public/index/order_refund/refuse', 'POST', {
    token,
    info_batchcode
  })
}

// 线上订单售后同意
export const orderRefundAgree = ({
  token,
  info_batchcode,
  pay_password
}) => {
  return ReqClient('/public/index/order_refund/agree', 'POST', {
    token,
    info_batchcode,
    pay_password
  })
}

// 汇率转换
export const currencyConversion = ({
}) => {
  return ReqClient('/public/index/currency/currency_conversion', 'POST', {
  })
}

// 添加银行卡
export const addProductBank = ({
  token,
  name,
  bankcard_id,
  opening_bank,
  opening_bank_branch_code,
  opening_bank_branch,
  opening_bank_code,
  provinceCode,
  cityCode
}) => {
  return ReqClient('/public/index/bankcard/add_product_bank', 'POST', {
    token,
    name,
    bankcard_id,
    opening_bank,
    opening_bank_branch_code,
    opening_bank_branch,
    opening_bank_code,
    provinceCode,
    cityCode
  })
}

// 修改银行卡
export const upBannk = ({
  token,
  bank_id,
  name,
  bankcard_id,
  opening_bank,
  opening_bank_branch_code,
  opening_bank_branch,
  opening_bank_code,
  provinceCode,
  cityCode
}) => {
  return ReqClient('/public/index/bankcard/up_bannk', 'POST', {
    token,
    bank_id,
    name,
    bankcard_id,
    opening_bank,
    opening_bank_branch_code,
    opening_bank_branch,
    opening_bank_code,
    provinceCode,
    cityCode
  })
}

// 删除私户银行卡列表
export const deBannk = ({
  token,
  bank_id
}) => {
  return ReqClient('/public/index/bankcard/de_bannk', 'POST', {
    token,
    bank_id
  })
}

// 删除私户银行卡列表
export const withdrawPrivate = ({
  token,
  money,
  pay_password,
  bankcard_id
}) => {
  return ReqClient('/public/index/merchant/withdraw_private', 'POST', {
    token,
    money,
    pay_password,
    bankcard_id
  })
}

// 拍卖列表
export const productgetBid = ({
  token,
  page
}) => {
  return ReqClient('/public/index/product/get_bid', 'POST', {
    token,
    page
  })
}

// 购物车
export const getBidCart = ({
  token
}) => {
  return ReqClient('/public/index/auction/get_bid_cart', 'POST', {
    token
  })
}
export const merchantUpdate = ({
  token,
  shopname
}) => {
  return ReqClient('/public/index/user/merchant_update', 'POST', {
    token,
    shopname
  })
}
export const merchantProfile = ({
  token
}) => {
  return ReqClient('/public/index/user/merchant_profile', 'POST', {
    token
  })
}
export const identifyCertification = ({
  token,
  merFullName,
  legalName,
  legalIdCard,
  merCity,
  merDistrict,
  merProvince,
  merAddress,
  fileInfo
}) => {
  return ReqClient('/public/index/merchant/identify_certification', 'POST', {
    token,
    merFullName,
    legalName,
    legalIdCard,
    merCity,
    merDistrict,
    merProvince,
    merAddress,
    fileInfo
  })
}
export const bankCertification = ({
  token,
  cardNo,
  headBankCode,
  bankCode,
  bankProvince,
  bankCity,
  fileInfo
}) => {
  return ReqClient('/public/index/merchant/bank_certification', 'POST', {
    token,
    cardNo,
    headBankCode,
    bankCode,
    bankProvince,
    bankCity,
    fileInfo
  })
}
//明细账单
export const billDetailsInfo = ({
  token,
  id
}) => {
  return ReqClient('/public/index/user/bill_details_info', 'POST', {
    token,
    id
  })
}
export const addProduct = ({
  token,
  is_network,
  image,
  product_condition,
  is_shelf,
  procurement_status,
  category_id,
  type_id,
  brand_id,
  systematics_id,
  product_code,
  product_sn,
  product_name,
  maintenance,
  store_id,
  coordinate,
  library_age,
  remark,
  cost_price,
  price,
  peer_price,
  additional,
  staff_id,
  activity_price,
  market_price,
  product_service,
  group_people,
  color,
  material,
  size,
  product_package,
  watchshell_material,
  watchband_material,
  mechanism,
  diameter,
  fastener_type,
  waterproof,
  guarantee,
  producer,
  is_onsale,
  stock,
  product_source,
  fineness_description,
  synopsis
}) => {
  return ReqClient('/public/index/product/add_product', 'POST', {
    token,
    is_network,
    image,
    product_condition,
    is_shelf,
    procurement_status,
    category_id,
    type_id,
    brand_id,
    systematics_id,
    product_code,
    product_sn,
    product_name,
    maintenance,
    store_id,
    coordinate,
    library_age,
    remark,
    cost_price,
    price,
    peer_price,
    additional,
    staff_id,
    activity_price,
    market_price,
    product_service,
    group_people,
    color,
    material,
    size,
    product_package,
    watchshell_material,
    watchband_material,
    mechanism,
    diameter,
    fastener_type,
    waterproof,
    guarantee,
    producer,
    is_onsale,
    stock,
    product_source,
    fineness_description,
    synopsis
  })
}
//快速添加商品
export const addactivityProduct = ({
  token,
  image,
  commission_price,
  product_sn
}) => {
  return ReqClient('/public/index/auction/add_product', 'POST', {
    token,
    image,
    commission_price,
    product_sn
  })
}
//选取出品商品列表
export const productLists = ({
  token,
 page
}) => {
  return ReqClient('/public/index/auction/product_list', 'POST', {
    token,
    page
  })
}
//出品商品
export const addProducts = ({
  token,
  products
}) => {
  return ReqClient('/public/index/auction/add_products', 'POST', {
    token,
    products
  })
}

// 获取已出品的商品
export const myBidProducts = ({
  token,
  page
}) => {
  return ReqClient('/public/index/auction/my_bid_products', 'POST', {
    token,
    page
  })
}
export const onePurchase = ({
  token,
  product_ids,
  delivery_id,
  total_price,
  remark
}) => {
  return ReqClient('/public/index/order/add_order', 'POST', {
    token,
    product_ids,
    delivery_id,
    total_price,
    remark
  })
}
